﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CoreBDS;
using Cvk.News;

namespace BatDongSan.Master
{
    public partial class News : System.Web.UI.MasterPage
    {
        public static int _idparent;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                
                
                _idparent = Convert.ToInt32(Request.QueryString["idt"]);
                try
                {
                    int loai = NewsBll.claNewsType.GetParentId(_idparent, Utility.strConnect);
                    if (loai == 1)//tintuc
                    {
                        Advertisement1.LoadBannerList(5, 1, "180", "0");
                    }
                    else if (loai == 7)//Cam nang
                    {
                        Advertisement1.LoadBannerList(10, 1, "180", "0");
                    }
                    else if (loai == 12)//phong thuy
                    {
                        Advertisement1.LoadBannerList(11, 1, "180", "0");
                    }
                    else
                    {
                        Advertisement1.LoadBannerList(5, 1, "180", "0");
                    }
                }
                catch
                {
                    Advertisement1.LoadBannerList(5, 1, "180", "0");
                }

                if (_idparent > 0)
                {
                    //Utility.LoadHeader(Page, Global.idCulture(), _idparent, Global.strConnect());
                    Uct_News_Menu1.LoadMenuChild(_idparent);
                }
                else
                {
                    //Utility.LoadHeader(Page, Global.idCulture(), 1, Global.strConnect());
                    Uct_News_Menu1.LoadMenuChild(1);
                }
            }
        }
    }
}